Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

change import of ZHAGateway from zha.core #240

Merged
merged 5 commits into from
Aug 1, 2024

Conversation

ChristophCaina
Copy link
Contributor

fix #237

@CordoWEB
Copy link

CordoWEB commented Aug 1, 2024

If this works ... do not forget to say thank you to the author ... me :)

@ChristophCaina
Copy link
Contributor Author

ChristophCaina commented Aug 1, 2024

sure, thanks a lot @CordoWEB

at least, the error is gone... ;)

@mdeweerd
Copy link
Owner

mdeweerd commented Aug 1, 2024

I like to keep the code backward compatible.

I guess the easiest approach here is to do it with a try construct: load the new one first and if that does not work, try the old path.

@mdeweerd
Copy link
Owner

mdeweerd commented Aug 1, 2024

Also, using "import ... as .ZHAGateway" should avoid the issue reported by the tools.

@ChristophCaina
Copy link
Contributor Author

I'll change it and see, if it is working (but I cannot test the exception case)

@CordoWEB
Copy link

CordoWEB commented Aug 1, 2024

You can also test HA version :

if parse_version(HA_VERSION) >= parse_version("2024.8"):
    from homeassistant.components.zha import Gateway as ZHAGateway
else
    from homeassistant.components.zha.core.gateway import ZHAGateway

@mdeweerd mdeweerd merged commit dcd2b82 into mdeweerd:main Aug 1, 2024
4 checks passed
@mdeweerd
Copy link
Owner

mdeweerd commented Aug 1, 2024

Thank you @CordoWEB and @ChristophCaina . It's released in 1.1.12

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Setup failed with 2024.8.0b0
3 participants